﻿{% extends "layout/base.html" %}

{% block ariane %}
<a href="/">Accueil </a> > <a href="/listeFilms/">Films</a>
{% endblock ariane %}

{% block content %}
                {% if subject == "null" %}
                <script type="text/javascript">
                   function menuderoulant(selection){
                       window.location="/listeFilms/?mode="+selection.options[selection.selectedIndex].value;
                   }
                </script>
                {% else %}
                <script type="text/javascript">
                   function menuderoulant(selection){
                       window.location="/listeFilms/?mode="+selection.options[selection.selectedIndex].value+"&sub="+"{{subject}}";
                   }
                </script>
                 {% endif %}

           	<h2 class="infoG">FILMS</h2>
                
                <div class="headpiece">
                <!-- <span class="left">Nombre de résultats</span> --> <span class="center"><FORM>
                                                                                    <select name="affichage" size="1"onChange="menuderoulant(this)">
                                                                                    	<option>Trier par</option>
                                                                                    	<option value="title">Titre film</option>
                                                                                   		<option value="-rating_imdb">Classement IMDB</option>
                                                                                   	 	</select>
                                                                                    </FORM></span> <!-- <span class="right"> < 1 - 2 > </span> -->
                </div>
                
                <div class="Resultatlisting">
					{% for m in movie %}
                                        {% if subject == "null" %}
                                        <div class="listing">
                   		<img src="{{ m.cover }}" />
                        <div class="info">
                        	<b class="title">{{ m.title }}</b><br/>
                           <span class="l2"> <b class="rating">IMDB : </b>{{ m.rating_imdb }} / 10 | <b>IMAC : </b> **** <br/> </span>
                             <span class="l3"><b>Genre:</b> {% for g in m.get_genre %}{{ g.name }} {% endfor %}|      <b>Matière:</b>{% for comment in m.coursecomment_set.all %} {{comment.course.topic}}   {% endfor %}     </span>
                 		</div>

                         <div class="button">
                           <span><a href="/fichefilm/?mid={{ m.id }}">VOIR CETTE FICHE</a></span>

                 		 </div>

               		 </div>
                                        {% else %}
                                        {% for comment2 in m.coursecomment_set.all %}
                                          {% if comment2.course.topic == subject %}

                   	<div class="listing">
                   		<img src="{{ m.cover }}" />
                        <div class="info">
                        	<b class="title">{{ m.title }}</b><br/>
                           <span class="l2"> <b class="rating">IMDB : </b>{{ m.rating_imdb }} / 10 | <b>IMAC : </b> **** <br/> </span>
                             <span class="l3"><b>Genre:</b> {% for g in m.get_genre %}{{ g.name }} {% endfor %}|      <b>Matière:</b>{% for comment in m.coursecomment_set.all %} {{comment.course.topic}}   {% endfor %}     </span>              
                 		</div>
                        
                         <div class="button">
                           <span><a href="/fichefilm/?mid={{ m.id }}">VOIR CETTE FICHE</a></span>

                 		 </div>
                
               		 </div>

                                            {% endif %}
                                        {% endfor %}
                                        {% endif %}
					{% endfor %}					 
                </div>

{% endblock content %}
